<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>

  
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Winform Development</title>
  

  
  
  <meta name="id" content="64e3dc97-5125-541e-9e84-7f9303e95f27">

  
  <meta name="revisionNumber" content="1"></head><body>
<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNormal">
</p>

<div style="border: 3pt solid rgb(219, 229, 241); padding: 0in; background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<h2 style="background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">Toolbox
Configuration</h2>
</div>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">If you
are developing a <b>Winform</b> application you should add the
FacebookService
component to your toolbox in Visual Studio. To do this, right-click in
the area
of the toolbox where you want the controls to go, and select &#8220;Choose
Items&#8221;
from the pop-up menu.<u1:p></u1:p><br>
<br>
<u2:shapetype id="_x0000_t75" coordsize="21600,21600" u1:spt="75" u1:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><u2:stroke joinstyle="miter"><u2:formulas><u2:f eqn="if lineDrawn pixelLineWidth 0"><u2:f eqn="sum @0 1 0"><u2:f eqn="sum 0 0 @1"><u2:f eqn="prod @2 1 2"><u2:f eqn="prod @3 21600 pixelWidth"><u2:f eqn="prod @3 21600 pixelHeight"><u2:f eqn="sum @0 0 1"><u2:f eqn="prod @6 1 2"><u2:f eqn="prod @7 21600 pixelWidth"><u2:f eqn="sum @8 21600 0"><u2:f eqn="prod @7 21600 pixelHeight"><u2:f eqn="sum @10 21600 0"></u2:f><u2:path u1:extrusionok="f" gradientshapeok="t" u1:connecttype="rect"><u1:lock u2:ext="edit" aspectratio="t"></u1:lock><u2:shape id="_x0000_i1025" type="#_x0000_t75" style="width: 242.25pt; height: 218.25pt;"><u2:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" u1:title="chooseItemsMenu"></u2:imagedata></u2:shape></u2:path></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:formulas></u2:stroke></u2:shapetype>In
the window that appears, click the &#8220;Browse&#8230;&#8221; button, locate
Facebook.Winforms.dll, and open it. Click &#8220;OK&#8221;, and the FacebookService
component and the various user controls should appear in your
toolbox.&nbsp;&nbsp; <u1:p></u1:p><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><img style="width: 323px; height: 291px;" alt="toolbox" src="image/Toolbox.png"><br>
</span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">To start
utilizing the Facebook API, you will need to add the FacebookService
component
to your project.&nbsp; To do this just drag an instance of
FacebookService from
the toolbox onto the component tray and enter your API Key. <o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"></span><img src="../../../../../Users/RPOWER%7E1.CLA/AppData/Local/Temp/moz-screenshot.jpg" alt=""></p>

<u1:p></u1:p>
<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><u2:shapetype id="_x0000_t75" coordsize="21600,21600" u1:spt="75" u1:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><u2:stroke joinstyle="miter"><u2:formulas><u2:f eqn="if lineDrawn pixelLineWidth 0"><u2:f eqn="sum @0 1 0"><u2:f eqn="sum 0 0 @1"><u2:f eqn="prod @2 1 2"><u2:f eqn="prod @3 21600 pixelWidth"><u2:f eqn="prod @3 21600 pixelHeight"><u2:f eqn="sum @0 0 1"><u2:f eqn="prod @6 1 2"><u2:f eqn="prod @7 21600 pixelWidth"><u2:f eqn="sum @8 21600 0"><u2:f eqn="prod @7 21600 pixelHeight"><u2:f eqn="sum @10 21600 0"></u2:f><u2:path u1:extrusionok="f" gradientshapeok="t" u1:connecttype="rect"><u1:lock u2:ext="edit" aspectratio="t"></u1:lock><u2:shape id="Picture_x0020_1" u1:spid="_x0000_i1025" type="#_x0000_t75" style="width: 285pt; height: 75.75pt; visibility: visible;"><u2:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" u1:title=""></u2:imagedata><u1:p></u1:p></u2:shape></u2:path></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:formulas></u2:stroke></u2:shapetype><br>
The FacebookService component contains methods that wrap all of the
methods of
the Facebook API.&nbsp; The following provides an example for getting
all the
friends of the logged in user.&nbsp; This method returns a generic
collection
of user objects.&nbsp; The user object is a strongly typed
representation of a
Facebook User profile.<o:p></o:p></span></p>

<div style="border: 3pt solid rgb(219, 229, 241); padding: 0in; background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<h2 style="background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><u2:shapetype id="_x0000_t75" coordsize="21600,21600" u1:spt="75" u1:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><u2:stroke joinstyle="miter"><u2:formulas><u2:f eqn="if lineDrawn pixelLineWidth 0"><u2:f eqn="sum @0 1 0"><u2:f eqn="sum 0 0 @1"><u2:f eqn="prod @2 1 2"><u2:f eqn="prod @3 21600 pixelWidth"><u2:f eqn="prod @3 21600 pixelHeight"><u2:f eqn="sum @0 0 1"><u2:f eqn="prod @6 1 2"><u2:f eqn="prod @7 21600 pixelWidth"><u2:f eqn="sum @8 21600 0"><u2:f eqn="prod @7 21600 pixelHeight"><u2:f eqn="sum @10 21600 0"></u2:f><u2:path u1:extrusionok="f" gradientshapeok="t" u1:connecttype="rect"><u1:lock u2:ext="edit" aspectratio="t"></u1:lock><u2:shape id="Picture_x0020_1" u1:spid="_x0000_i1025" type="#_x0000_t75" style="width: 285pt; height: 75.75pt; visibility: visible;"><u2:imagedata src="file:///C:%5CUsers%5CRPOWER%7E1.CLA%5CAppData%5CLocal%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_image001.png" u1:title=""></u2:imagedata></u2:shape></u2:path></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:f></u2:formulas></u2:stroke></u2:shapetype>Using
the FacebookService Component</h2>
</div>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">In order
to leverage the facebook platform from a winform application you first
need to
establish a facebook session on behalf of the user of your
application.&nbsp;
The first time a user is using your application, this will require
showing them
a facebook login page and then getting back a new secret key that is
specific
to their session and also the session key associated with the facebook
session
that they just initiated.&nbsp; The Toolkit provides a easy wrapper
method that
allows you to do this.&nbsp; Allow you have to do is call
ConnectToFacebook on
the instance of FacebookService that you created by dragging it onto
your
form.&nbsp; After you have a valid session you can access the various
elements
of data using accessor properties on your FacebookService
instance.&nbsp; When calling ConnectToFacebook you can optionally pass
in a set of Required Permissions that the user should be prompted for
when logging in to your application.<o:p></o:p></span></p>

<ul type="disc">
<li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">service.uid - the
facebook user id of the logged in user<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">service.SessionKey -
The session key of the current facebook session (used when posts
requests to facebook on behalf of this user)<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">service.ApplicationSecret
- The application secret to use when making requests in this session<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">service.Api - an
instance of the Facebook.Rest.Api class.&nbsp; This is where all of the
Facebook Rest interfaces are implemented.<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">There is also an
accessor for each facebook Rest Api (so you don't have to go through
the Api class to get there (ie. Friends, Stream, Notifications, Events,
Groups, etc.)<o:p></o:p></span></li>
</ul>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">Now that
we have a valid session, we can use the FacebookService to make rest
api
calls.&nbsp; For more information on the rest api, go to </span><span style="font-size: 11pt; line-height: 115%; font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><a href="http://wiki.developers.facebook.com/index.php/API">http://wiki.developers.facebook.com/index.php/API</a>.&nbsp;
The following provides an example for getting all the friends of the
logged in
user.&nbsp; This method returns a generic collection of user
objects.&nbsp; The
user object is a strongly typed representation of a Facebook User
profile.</span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><b><span style="font-family: &quot;Courier New&quot;;">Visual C#</span></b><span style="font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><u1:p></u1:p><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-family: &quot;Courier New&quot;;">
System.Collections.Generic;<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-family: &quot;Courier New&quot;;">
System.Collections.ObjectModel;<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">using</span><span style="font-family: &quot;Courier New&quot;;">
facebook.Schema;<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;;">&#8230;<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: rgb(43, 145, 175);">IList</span><span style="font-family: &quot;Courier New&quot;;">&lt;<span style="color: rgb(43, 145, 175);">user</span>&gt;
friends = facebookService1.friends.getUserObjects();<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><b><span style="font-family: &quot;Courier New&quot;;">Visual Basic<u1:p></u1:p></span></b></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-family: &quot;Courier New&quot;;">
System.Collections.Generic<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-family: &quot;Courier New&quot;;">
System.Collections.ObjectModel<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;; color: blue;">Imports</span><span style="font-family: &quot;Courier New&quot;;">
facebook.Schema<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Courier New&quot;;">&#8230;<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;
<span style="color: blue;">Dim</span> friends <span style="color: blue;">As</span> IList(<span style="color: blue;">Of</span>
user) =
facebookService1.friends.getUserObjects()<u1:p></u1:p></span></p>

<div style="border: 3pt solid rgb(219, 229, 241); padding: 0in; background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<h2 style="background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">User
Controls<br>
</h2>
</div>

<p class="MsoNormal" style="margin-left: 22.5pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">If you
have just simple needs and want to display some typical facebook
information,
we have provided some user controls.&nbsp; <o:p></o:p></span></p>

<ul type="disc">
<li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">EventList - Lists all
the events owned by the logged in user<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">FriendList - Lists all
the friends of the logged in user<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">FriendMap - Uses
virtual earth to map the location of the logged in user's friends<o:p></o:p></span></li><li class="MsoNormal" style="line-height: normal;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">PhotoAlbum - Simple
album showing the photos that the logged in user has posted<o:p></o:p></span></li>
</ul>

<p class="MsoNormal" style="margin: 0in 0in 0.0001pt;"><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;
The following walks through the basic steps you would need to do to use
leverage one of these controls <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 1. Drag a FriendList from the
toolbox
onto the design surface for the form</span>&nbsp;&nbsp; <span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;">&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><img style="width: 472px; height: 246px;" alt="toolbox" src="image/WinformsToolbox.png"></span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 2. Find Load in the Event list in
the
property window, type Form_Load.&nbsp; Press Enter.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; </span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><img style="width: 271px; height: 188px;" alt="form load" src="image/formload.png"></span><span style="font-family: &quot;Helvetica&quot;,&quot;sans-serif&quot;;"><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 3. In the generated Form_Load
method, set
the Friends property of the FriendList control to the Collection
returned by
calling the GetFriends method of the FacebookService.&nbsp; As shown
here:<u1:p></u1:p></span><span style="font-family: &quot;Times New Roman&quot;,&quot;serif&quot;;"><o:p></o:p></span></p>

<p class="MsoNormal" style="margin-left: 0.5in;"><b><span style="font-family: &quot;Courier New&quot;;">Visual
C#<u1:p></u1:p></span></b></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color: blue;">private</span>
<span style="color: blue;">void</span> Form_Load(<span style="color: blue;">object</span>
sender, <span style="color: rgb(43, 145, 175);">EventArgs</span> e)<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
{<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
friendList1.Friends = facebookService1.friends.getUserObjects();<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<u1:p></u1:p></span></p>

<p class="MsoNormal" style="margin-left: 22.5pt;"><b><span style="font-family: &quot;Courier New&quot;;">Visual Basic<u1:p></u1:p></span></b></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;
<span style="color: blue;">&nbsp;&nbsp;&nbsp; Private</span>
<span style="color: blue;">Overloads</span> <span style="color: blue;">Sub</span>
OnLoad()<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;friendList1.Friends =
FacebookService1.friends.getUserObjects()<u1:p></u1:p></span></p>

<p class="MsoNormal" style=""><span style="font-family: &quot;Courier New&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color: blue;">End</span> <span style="color: blue;">Sub</span></span></p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<div style="border: 3pt solid rgb(219, 229, 241); padding: 0in; background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<h2 style="background: rgb(219, 229, 241) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">Resources</h2>
</div>

<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis">Facebook Developer
Toolkit:<span style="">&nbsp; </span></span><a href="http://facebooktoolkit.codeplex.com/"><span class="MsoSubtleReference"><span style="text-decoration: none;">http://facebooktoolkit.codeplex.com</span></span></a></p>

<span style="font-family: Helvetica,Arial,sans-serif;" class="MsoIntenseEmphasis"></span><span class="MsoIntenseEmphasis"><span style="text-transform: none; font-weight: normal;"><o:p>&nbsp;</o:p></span></span>

<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis">Facebook Developer WIKI
Page:<span style="">&nbsp; </span></span><span class="MsoSubtleReference"><a href="http://wiki.developers.facebook.com/index.php/Main_Page">http://wiki.developers.facebook.com/index.php/Main_Page</a><o:p></o:p></span></p>


<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing">Facebook
Developer wiki, the official documentation for
the Facebook Platform.</p>


<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis"><span style="text-transform: none; font-weight: normal;"><o:p>&nbsp;</o:p></span></span></p>

<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis">Extended Permissions
Documentation: </span><span class="MsoSubtleReference"><a href="http://wiki.developers.facebook.com/index.php/Extended_permissions">http://wiki.developers.facebook.com/index.php/Extended_permissions</a><o:p></o:p></span></p>


<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis">Official documentation for
extended permissions.</span><span class="MsoIntenseEmphasis"><span style="text-transform: none; font-weight: normal;"><o:p></o:p></span></span></p>


<p style="font-family: Helvetica,Arial,sans-serif;" class="MsoNoSpacing"><span class="MsoIntenseEmphasis"><o:p>&nbsp;</o:p></span></p>

<br>
</body></html>